import 'package:json_annotation/json_annotation.dart'; 
  
part 'comment_detailst_model.g.dart';

// 通过id获取全部评论
@JsonSerializable()
  class CommentDetailstModel extends Object {

  @JsonKey(name: 'code')
  int code;

  @JsonKey(name: 'message')
  String message;

  @JsonKey(name: 'data')
  List<Data> data;

  CommentDetailstModel(this.code,this.message,this.data,);

  factory CommentDetailstModel.fromJson(Map<String, dynamic> srcJson) => _$CommentDetailstModelFromJson(srcJson);

  Map<String, dynamic> toJson() => _$CommentDetailstModelToJson(this);

}

  
@JsonSerializable()
  class Data extends Object {

  @JsonKey(name: 'user_id')
  int userId;

  @JsonKey(name: 'nick_name')
  String nickName;

  @JsonKey(name: 'head_img')
  String headImg;

  @JsonKey(name: 'sex')
  int sex;

  @JsonKey(name: 'c_id')
  int cId;

  @JsonKey(name: 'content')
  String content;

  @JsonKey(name: 'comment_time')
  int commentTime;

  @JsonKey(name: 'replies')
  List<Replies> replies;

  Data(this.userId,this.nickName,this.headImg,this.sex,this.cId,this.content,this.commentTime,this.replies,);

  factory Data.fromJson(Map<String, dynamic> srcJson) => _$DataFromJson(srcJson);

  Map<String, dynamic> toJson() => _$DataToJson(this);

}

  
@JsonSerializable()
  class Replies extends Object {

  @JsonKey(name: 'r_id')
  int rId;

  @JsonKey(name: 'user')
  User user;

  @JsonKey(name: 'to_user')
  To_user toUser;

  @JsonKey(name: 'content')
  String content;

  @JsonKey(name: 'reply_time')
  int replyTime;

  Replies(this.rId,this.user,this.toUser,this.content,this.replyTime,);

  factory Replies.fromJson(Map<String, dynamic> srcJson) => _$RepliesFromJson(srcJson);

  Map<String, dynamic> toJson() => _$RepliesToJson(this);

}

  
@JsonSerializable()
  class User extends Object {

  @JsonKey(name: 'user_id')
  int userId;

  @JsonKey(name: 'nick_name')
  String nickName;

  @JsonKey(name: 'head_img')
  String headImg;

  @JsonKey(name: 'sex')
  int sex;

  User(this.userId,this.nickName,this.headImg,this.sex,);

  factory User.fromJson(Map<String, dynamic> srcJson) => _$UserFromJson(srcJson);

  Map<String, dynamic> toJson() => _$UserToJson(this);

}

  
@JsonSerializable()
  class To_user extends Object {

  @JsonKey(name: 'user_id')
  int userId;

  @JsonKey(name: 'nick_name')
  String nickName;

  @JsonKey(name: 'head_img')
  String headImg;

  @JsonKey(name: 'sex')
  int sex;

  To_user(this.userId,this.nickName,this.headImg,this.sex,);

  factory To_user.fromJson(Map<String, dynamic> srcJson) => _$To_userFromJson(srcJson);

  Map<String, dynamic> toJson() => _$To_userToJson(this);

}

  
